package com.web.utils;

import java.sql.Date;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;

/**
 * 作者: jack
 * 时间: 2021-03-16 0016 09:53
 * 描述: DateUtil
 */
public class DateUtil {

    private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

    public static Date parseDate(java.util.Date date) {
        return new Date(date.getTime());
    }

    public static Timestamp parseTimestamp(java.util.Date date) {
        return new Timestamp(date.getTime());
    }

    public static java.util.Date parseStr(String dateStr) {
        java.util.Date date = null;
        try {
            date = sdf.parse(dateStr);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return date;
    }

}
